<!DOCTYPE html>
<html>
<head>
<title>订单管理</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <link rel="stylesheet" href="https://unpkg.com/bootstrap@3.3.7/dist/css/bootstrap.min.css">
  <link rel="stylesheet" href="https://unpkg.com/font-awesome@4.7.0/css/font-awesome.min.css">
  <link rel="stylesheet" href="https://unpkg.com/admin-lte@2.3.8/dist/css/AdminLTE.min.css">
  <link rel="stylesheet" href="https://unpkg.com/admin-lte@2.3.8/dist/css/skins/_all-skins.min.css">
  <link rel="stylesheet" href="https://unpkg.com/bootstrap-table@1.11.1/dist/bootstrap-table.min.css">
  <link rel="stylesheet" href="/css/main.css">
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div id="app" class="wrapper" v-cloak>

  <main-header></main-header>
  <main-sidebar></main-sidebar>
  <!-- =============================================== -->
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <content-header title="订单管理"></content-header>

    <!-- Main content -->
    <section class="content">
	<div v-show="showList">
		<div class="box">
			<div class="box-header with-border">
              <h3 class="box-title">列表</h3>
            </div><!-- /.box-header -->
            <div class="box-body">
				<div class="grid-btn">
					<div class="form-group col-sm-2">
						<input type="text" class="form-control" v-model="q.orderNumber" @keyup.enter="query" placeholder="订单编号">
					</div>
					<a class="btn btn-default" @click="query">查询</a>
					<a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
				</div>
			    <table id="table"></table>
			</div>
		</div>
    </div>
    
    <div v-show="!showList">
    	<div class="row">
    		<div class="col-sm-12">
    			<div class="box">
					<div class="box-header with-border">
		              <h3 class="box-title">订单信息</h3>
		            </div><!-- /.box-header -->
		            <div class="box-body">
						<form class="form-horizontal">
							<div class="form-group">
							   	<div class="col-sm-2 control-label">订单编号</div>
							   	<div class="col-sm-7">
							      <div class="checkbox">
							   	  	<label>
							   	  		{{order.orderNumber}}
							   	  	</label>
							   	  </div>
							    </div>
							</div>
							<div class="form-group">
							   	<div class="col-sm-2 control-label">订单时长</div>
							   	<div class="col-sm-7">
							      <div class="checkbox">
							   	  	<label>
							   	  		{{order.startDate}}
							   	  	</label>
							   	  </div>
							    </div>
							</div>

<!--							<div class="form-group">-->
<!--							   	<div class="col-sm-2 control-label">订单状态</div>-->
<!--							   	<div class="col-sm-7">-->
<!--							      <div class="checkbox">-->
<!--							   	  	<label v-if="order.orderStatus == 0">-->
<!--							   	  		已取消-->
<!--							   	  	</label>-->
<!--							   	  	<label v-if="order.orderStatus == 1">-->
<!--							   	  		订单中-->
<!--							   	  	</label>-->
<!--							   	  	<label v-if="order.orderStatus == 2">-->
<!--							   	  		已归还-->
<!--							   	  	</label>-->
<!--							   	  </div>-->
<!--							    </div>-->
<!--							</div>-->
							<div class="form-group">
							   	<div class="col-sm-2 control-label">下单时间</div>
							   	<div class="col-sm-7">
							      <div class="checkbox">
							   	  	<label>
							   	  		{{order.createTime}}
							   	  	</label>
							   	  </div>
							    </div>
							</div>
						</form>
					</div>
				</div>
    		</div>
    	</div>
    
    	<div class="box">
			<div class="box-header with-border">
              <h3 class="box-title">订单图书</h3>
            </div><!-- /.box-header -->
            <div class="box-body">
				<table class="table table-bordered">
					<thead>
						<tr>
							<th>图书图片</th>
							<th>图书名称</th>
							<th>数量</th>
							<th>作者</th>
						</tr>
					</thead>
					<tbody>
						<tr v-for="orderBook in order.orderBookList">
							<td>
								<img alt="" :src="orderBook.picUrl" width="64px" height="80px">
							</td>
							<td>{{orderBook.bookName}}</td>
							<td>{{orderBook.num}}</td>
							<td>{{orderBook.author}}</td>
						</tr>
					</tbody>
				</table>
				
				<br>
				<a class="btn btn-primary" @click="returnBook" v-if="order.orderStatus == 1">归还</a>
				<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
			</div>
		</div>
	</div>
	</section>
	</div>
</div>
<script src="https://unpkg.com/jquery@2.2.4/dist/jquery.min.js"></script>
<script src="https://unpkg.com/vue@2.2.6/dist/vue.min.js"></script>
<script src="https://unpkg.com/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
<script src="https://unpkg.com/bootstrap-table@1.11.1/dist/bootstrap-table.min.js"></script>
<script src="https://unpkg.com/admin-lte@2.3.8/dist/js/app.js"></script>
<script src="/js/admin/components.js"></script>
<script src="/js/admin/common.js"></script>
<script src="/js/admin/order/order.js"></script>
</body>
</html>